SET(TARGET_NAME OpenTissueLib)

#必须要有的宏定义

ADD_DEFINITIONS (-DOpenTissueLibrary_EXPORT)
#ADD_DEFINITIONS (-DBOOST_ALL_NO_LIB)
#ADD_DEFINITIONS (-DBOOST_PROGRAM_OPTIONS_DYN_LINK)
#ADD_DEFINITIONS (-DBOOST_TEST_DYN_LINK)


IF (CMAKE_CL_64)


ELSE()
ENDIF()
	#INCLUDE_DIRECTORIES( ${OSG_DIR}/include )
	#LINK_DIRECTORIES( ${OSG_DIR}/lib )


	
	#INCLUDE_DIRECTORIES( ${OSG_WORKS_DIR}/include )
	#LINK_DIRECTORIES( ${OSG_WORKS_DIR}/lib )
	
	#INCLUDE_DIRECTORIES( ${LUA_DIR}/include)
	#LINK_DIRECTORIES(${LUA_DIR}/lib)
	
	#INCLUDE_DIRECTORIES( ${LIBXL_DIR}/include)
	#LINK_DIRECTORIES( ${LIBXL_DIR}/lib)
	
	#INCLUDE_DIRECTORIES( ${BULLET_DIR}/include)
	#LINK_DIRECTORIES( ${BULLET_DIR}/lib)
	
	#INCLUDE_DIRECTORIES( ${OSG_BULLET_DIR}/include )
	#LINK_DIRECTORIES( ${OSG_BULLET_DIR}/lib )
	

	#INCLUDE_DIRECTORIES( ${OMPL_DIR}/include)
	#LINK_DIRECTORIES( ${OMPL_DIR}/lib )
        INCLUDE_DIRECTORIES( ${BOOST_DIR}/include)
        LINK_DIRECTORIES( ${BOOST_DIR}/lib)

        INCLUDE_DIRECTORIES( ${QHULL}/include)
        LINK_DIRECTORIES( ${QHULL}/lib)

        INCLUDE_DIRECTORIES( ${OPENGL})
        LINK_DIRECTORIES( ${OPENGL}/lib)

        INCLUDE_DIRECTORIES( ${CG}/include)
        LINK_DIRECTORIES( ${CG}/lib)

        INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/${TARGET_NAME}/include)
        LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/bin/lib)

        #INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/OsgLib/include)

        INCLUDE_DIRECTORIES(${OPEN_TISSUE})
        LINK_DIRECTORIES(${OPEN_TISSUE}/lib)

        INCLUDE_DIRECTORIES(${OPEN_THREADS}/include)
        LINK_DIRECTORIES(${OPEN_THREADS}/lib)


#库文件在debug下名字后面加d
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")
SET(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")


FILE(GLOB_RECURSE ThisTarget_INCLUDE_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/include/*.h")
FILE(GLOB_RECURSE ThisTarget_SRC_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/src/*.cpp")
source_group("include" FILES ${ThisTarget_INCLUDE_LIST})
source_group("src" FILES ${ThisTarget_SRC_LIST})

ADD_LIBRARY(${TARGET_NAME} SHARED ${ThisTarget_SRC_LIST} ${ThisTarget_INCLUDE_LIST})

SET(ADDITIONAL_LIBRARIES_RELEASE 
                                glew32.lib
                                cg.lib
                                cgGL.lib
                                OpenThreads.lib
				)   

SET(ADDITIONAL_LIBRARIES_DEBUG 
                                glew32d.lib
                                cg.lib
                                cgGL.lib
                                OpenThreadsd.lib
				)
TARGET_LINK_LIBRARIES(${TARGET_NAME} debug "${ADDITIONAL_LIBRARIES_DEBUG}" optimized "${ADDITIONAL_LIBRARIES_RELEASE}")

set_target_properties(${TARGET_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/lib)
set_target_properties(${TARGET_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/lib)
set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/bin)
set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/bin)









